# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DiscoveryBigQueryConditions do
  @moduledoc """
  Requirements that must be true before a table is scanned in discovery for the first time. There is an AND relationship between the top-level attributes. Additionally, minimum conditions with an OR relationship that must be met before Cloud DLP scans a table can be set (like a minimum row count or a minimum table age).

  ## Attributes

  *   `createdAfter` (*type:* `DateTime.t`, *default:* `nil`) - BigQuery table must have been created after this date. Used to avoid backfilling.
  *   `orConditions` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2OrConditions.t`, *default:* `nil`) - At least one of the conditions must be true for a table to be scanned.
  *   `typeCollection` (*type:* `String.t`, *default:* `nil`) - Restrict discovery to categories of table types.
  *   `types` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2BigQueryTableTypes.t`, *default:* `nil`) - Restrict discovery to specific table types.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createdAfter => DateTime.t() | nil,
          :orConditions => GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2OrConditions.t() | nil,
          :typeCollection => String.t() | nil,
          :types => GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2BigQueryTableTypes.t() | nil
        }

  field(:createdAfter, as: DateTime)
  field(:orConditions, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2OrConditions)
  field(:typeCollection)
  field(:types, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2BigQueryTableTypes)
end

defimpl Poison.Decoder, for: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DiscoveryBigQueryConditions do
  def decode(value, options) do
    GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DiscoveryBigQueryConditions.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DiscoveryBigQueryConditions do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
